package hibernate.hibernateInterface;

public class CompareCond {
	
	final public static int EQU = 0;
	final public static int GEQU = 1; 
	final public static int GTHAN = 2;
	final public static int LEQU = -1;
	final public static int LTHAN = -2;
	
	public static String parseCompareScript(int script)throws Exception
	{
		if (script > GTHAN || script < LTHAN)
			throw new Exception("WrongParameter!");
		else if (script == EQU)
			return " = ";
		else if (script > EQU)
		{
			if (script == GEQU)
				return " >= ";
			else
				return " > ";
		}
		else
		{
			if (script == LEQU)
				return " <= ";
			else
				return "<";
		}
	}
}
